import { create } from 'zustand'
import fetch from '../fetch'

const useStore = create((set) => ({
  info: null,
  async fetchInfo() {
    // const data = await fetch({
    //   url: 'https://c.m.163.com/nc/gl/newsapprnandroid/ft',
    //   params: {
    //     listType: 'story',
    //     tab: 'hot',
    //   },
    // })

    const data = await fetch({
      url: 'https://api.mifengs.com/worklife/api/v1/ugc/detail',
      params: {
        recommendId: 'WFC0967BHI1S6ZZW',
      },
    })
    set({ info: data })
  },
}))

export default useStore
